<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="accountCount" content="4"> 
<title>Set Html Into Div</title>
<script src="../js/jquery-1.3.2.js"></script>
<script>
//change meta tag   content from 4 to 3
$(function() {		
	populateList(hideDivWhenListCountMatchAccountCount);	
		
});

function hideDivWhenListCountMatchAccountCount () {
	var listItemCount = $("li").length;
	var accountCountString = $("meta[name='accountCount']").attr("content");
	if (parseInt(accountCountString) === listItemCount) {
		$("div").hide();
	}
}

function populateList(callback) {
	$.get("/struts2Fill/addPerson.action",function(){
		$("ul").html("<li>hi1</li><li>hi2</li><li>hi3</li><li>hi4</li>");
		callback();
	});
}

</script>

</head>
<body>
	<ul id="itemList">
	</ul>
	<div id="someDiv">with text in a div
	</div>
</body>
</html>
